<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../head.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>babasport-edit</title>
</head>
<body>
<div class="box-positon">
    <div class="rpos">当前位置: 商品管理 - 添加</div>
    <form class="ropt">
        <input type="submit" onclick="this.form.action='/product/list.do';" value="返回列表" class="return-button"/>
    </form>
    <div class="clear"></div>
</div>
<script type="application/javascript">
//上传图片
    function uploadPic() {
        //jquery.form.js
        var options = {
            url:"/upload/uploadPic.do",
            dataType:"json",
            type:"post",
            success:function(data){
                $("#allUrl").attr("src",data.url);
                $("#imgUrl").val(data.url);
            }

        }

        $("#jvForm").ajaxSubmit(options);
    }
</script>
<div class="body-box" style="float:right">
    <form id="jvForm" action="edit.do" method="post">
        <table cellspacing="1" cellpadding="2" width="100%" border="0" class="pn-ftable">
            <tbody>
            <tr>
                <td width="20%" class="pn-flabel pn-flabel-h">
                    <span class="pn-frequired">*</span>
                    商品名称:</td><td width="80%" class="pn-fcontent">
                <input type="hidden" value="${product.id}" name="id" id="id" />
                <input type="text" class="required" name="name" value="${product.name}" maxlength="300" size="100"/>
            </td>
            </tr>
            <tr>
                <td width="20%" class="pn-flabel pn-flabel-h">
                    <span class="pn-frequired">*</span>
                    上传商品图片(90x150尺寸):</td>
                <td width="80%" class="pn-fcontent">
                    注:该尺寸图片必须为90x150。
                </td>
            </tr>
            <tr>
                <td width="20%" class="pn-flabel pn-flabel-h"></td>
                <td width="80%" class="pn-fcontent">
                    <img width="100" height="100" id="allUrl"/>
                    <input type="hidden" name="imgUrl" src="${brand.imgUrl}" id="imgUrl"/>
                    <input type="file" name="pic" onchange="uploadPic()"/>
                </td>
            </tr>
            <tr>
                <td width="20%" class="pn-flabel pn-flabel-h">
                    是否新品:</td><td width="80%" class="pn-fcontent">
                <input type="radio" name="isNew" value="1" <c:if test="${product.isNew == 1}" >checked="checked"</c:if> />新品
                <input type="radio" name="isNew" value="0" <c:if test="${product.isNew == 0}" >checked="checked"</c:if> />非新品
            </td>
            </tr>
            <tr>
                <td width="20%" class="pn-flabel pn-flabel-h">
                    是否热卖:</td><td width="80%" class="pn-fcontent">
                <input type="radio" name="isHot" value="1" <c:if test="${product.isHot == 1}" >checked="checked"</c:if> />热卖
                <input type="radio" name="isHot" value="0" <c:if test="${product.isHot == 0}" >checked="checked"</c:if> />非热卖
            </td>
            </tr>
            <tr>
                <td width="20%" class="pn-flabel pn-flabel-h">
                    是否推荐:</td><td width="80%" class="pn-fcontent">
                <input type="radio" name="isCommend" value="1" <c:if test="${product.isCommend == 1}" >checked="checked"</c:if> />推荐
                <input type="radio" name="isCommend" value="0" <c:if test="${product.isCommend == 0}" >checked="checked"</c:if> />不推荐
            </td>
            </tr>
            <tr>
                <td width="20%" class="pn-flabel pn-flabel-h">
                    是否上架:</td><td width="80%" class="pn-fcontent">
                <input type="radio" name="isShow" value="1" <c:if test="${product.isShow == 1}" >checked="checked"</c:if> />上架
                <input type="radio" name="isShow" value="0" <c:if test="${product.isShow == 0}" >checked="checked"</c:if> />下架
            </td>
            </tr>
            </tbody>
            <tbody>
            <tr>
                <td class="pn-fbutton" colspan="2">
                    <input type="submit" class="submit" value="提交"/> &nbsp; <input type="reset" class="reset" value="重置"/>
                </td>
            </tr>
            </tbody>
        </table>
    </form>
</div>
</body>
</html>